<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Utils;
require_once __DIR__."/../Model/Request.php";
use Model\Request;
/**
 * Description of RequstUtils
 *
 * @author Administrator
 */
class RequstUtils {
     public static function Create($data) {
         date_default_timezone_set('Asia/Shanghai');
        $data["date"]= date("y-m-d h:i:s");
        $temp=new Request($data);
        if($temp->add())
        {
            return (array)$temp;
        }
        else
            return array("code"=>400);
    }
    public static function loadmore($from){
         return \Model\Request::get($from, $from+10);
    }

     public static function fresh() {
       
        return \Model\Request::get(0, 10);
    }

    public static function Remove($requestID) {
        unset(self::$Requst_array[$requestID]); 
    }
    public static function clear(){
        $time=date("Y-m-d H:i:s",strtotime("-1 day"));
    }
}